
public class Process {
	int processId;
	int arrivalTime, serviceTime, finishTime, timeLeft, Tq;
	double Tqs;
	
	int[] registerInfo = new int[11];

	static int barwidth, unitLength;

	/**
	 * Process constructor.
	 * @param processId
	 * @param arrivalTime
	 * @param serviceTime
	 */
	public Process(int processId, int arrivalTime, int serviceTime) {
		this.processId = processId;
		this.arrivalTime = arrivalTime;
		this.serviceTime = timeLeft = serviceTime;
	}
	
	public int getBarWidth() {
		return barwidth;
	}

	public int getUnitLength() {
		return unitLength;
	}

	public int getArrival() {
		return arrivalTime;
	}

	public int getTminus() {
		return timeLeft;
	}

	public int getProcessId() {
		return processId;
	}

	public int getServiceTime() {
		return serviceTime;
	}

	public int getFinish() {
		return finishTime;
	}

	public double getTq() {
		return Tq;
	}

	public double getTqs() {
		return Tqs;
	}
	
	public void setUnitLength(int x) {
		unitLength = x;
	}

	public void setBarWidth(int x) {
		barwidth = x;
	}

	public void servicing() {
		timeLeft--;
	}

	public void report(int t) {
		finishTime = t;
		Tq = finishTime - arrivalTime;
		Tqs = Math.round(Tq / serviceTime);
	} // calculate data
} // process class
